import { Provide, Scope, ScopeEnum } from "@midwayjs/core";
import wechat from 'wechat';
import { WechatMessage } from "../wechat/message.interface";
@Provide()
@Scope(ScopeEnum.Request)
export default class WechatService {
    message: WechatMessage;
    reply: Function;
    wechat(config) {
        return wechat(config, (req, res) => {
            this.message = req.weixin;
            this.reply = res.reply;
        });
    }
}